package lab02.test03;

public class Student {

     String name;
     String ssex;
     String num;

     double computerScore;
     double mathScore;
     double englishScore;

    //总成绩
    public double sumScore() {

        return computerScore + mathScore + englishScore;
    }
    //平均成绩
    public double averageScore(double sumScore) {
        return sumScore / 3;
    }

    public double minScore() {
        double min = computerScore;

        if (mathScore < min) {
            min = mathScore;
        } else if (englishScore < min) {
            min = englishScore;
        }

        return min;
    }

    public double maxScore() {
        double max = computerScore;

        if (mathScore > max) {
            max = mathScore;
        } else if (englishScore > max) {
            max = englishScore;
        }

        return max;
    }


    @Override
    public String toString() {
        return "姓名：" + name +
                "\n性别：" + ssex +
                "\n学号：" + num +
                "\n计算机成绩：" + computerScore +
                "\n数学成绩：" + mathScore +
                "\n英语成绩：" + englishScore +
                "\n总成绩：" + sumScore() +
                "\n平均成绩：" + averageScore(sumScore()) +
                "\n最高分：" + maxScore() +
                "\n最低分：" + minScore();
    }




    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public String getSsex() {
        return ssex;
    }

    public void setSsex(String ssex) {
        this.ssex = ssex;
    }

    public String getNum() {
        return num;
    }

    public void setNum(String num) {
        this.num = num;
    }

    public double getComputerScore() {
        return computerScore;
    }

    public void setComputerScore(double computerScore) {
        this.computerScore = computerScore;
    }

    public double getMathScore() {
        return mathScore;
    }

    public void setMathScore(double mathScore) {
        this.mathScore = mathScore;
    }

    public double getEnglishScore() {
        return englishScore;
    }

    public void setEnglishScore(double englishScore) {
        this.englishScore = englishScore;
    }


}
